<?php

namespace JLPay\Models\Marketing;

use JLPay\Models\BaseRequest;

/**
 * 营销活动查询请求模型
 */
class MarketingActivityQueryRequest extends BaseRequest
{
    /**
     * 赞助商ID
     * @var string|null
     */
    public ?string $sponsorId = null;

    /**
     * 页码
     * @var string|null
     */
    public ?string $page = null;

    /**
     * 每页数量限制
     * @var string|null
     */
    public ?string $limit = null;

    /**
     * 设置赞助商ID
     *
     * @param string $sponsorId 赞助商ID
     * @return $this
     */
    public function setSponsorId(string $sponsorId): self
    {
        $this->sponsorId = $sponsorId;
        return $this;
    }

    /**
     * 设置页码
     *
     * @param string $page 页码
     * @return $this
     */
    public function setPage(string $page): self
    {
        $this->page = $page;
        return $this;
    }

    /**
     * 设置每页数量限制
     *
     * @param string $limit 每页数量限制
     * @return $this
     */
    public function setLimit(string $limit): self
    {
        $this->limit = $limit;
        return $this;
    }

    /**
     * 获取接口路径
     *
     * @return string
     */
    public function path(): string
    {
        return "/open/org/bank/act-bridge/act/list/sponsor";
    }

    /**
     * 将请求对象转换为数组，过滤掉值为null的字段
     *
     * @return array
     */
    public function toArray(): array
    {
        $result = [];
        if ($this->sponsorId !== null) $result['sponsor_id'] = $this->sponsorId;
        if ($this->page !== null) $result['page'] = $this->page;
        if ($this->limit !== null) $result['limit'] = $this->limit;
        return $result;
    }
} 